<template name="databaseDumpRestore">
    {{> pageHeading title='Dump - Restore' }}

    {{#if isConnected}}
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>Import Extended Json / Mongoimport</h5>
                        </div>
                        <div class="ibox-content">
                            <form id="formStandardAuth" class="form-horizontal">
                                <div class="form-group">
                                    <label class="col-lg-1 control-label">Json File</label>
                                    <div class="col-lg-11">
                                        <input class="form-control filestyle" type="file"
                                               id="inputImportJsonFile"
                                               data-buttonName="btn-primary">
                                        <span class="help-block m-b-none">Don't forget to provide <b>--jsonArray</b> option while exporting your data with <b>mongoexport</b>,
                                            otherwise import won't work !</span>
                                    </div>
                                </div>

                                <div class="form-group"><label class="col-lg-1 control-label">Collection</label>
                                    <div class="col-lg-11">
                                        <select id="cmbImportCollection"
                                                data-placeholder="Choose a collection or enter one"
                                                class="chosen-select form-control"
                                                tabindex="-1">
                                            <option></option>
                                        </select>
                                    </div>
                                </div>

                            </form>
                        </div>
                        <div class="ibox-footer">
                            <div class="row">
                                <div class="col-lg-12">
                                    <button id="btnProceedMongoimport"
                                            class="btn btn-block btn-outline btn-primary ladda-button"
                                            type="button"
                                            data-style="contract">
                                        <strong>Import</strong></button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>Dumps for {{getConnection.name}}</h5>

                            <div class="ibox-tools">
                                <button id="btnRefreshDumps" type="button" class="btn btn-sm btn-primary">Refresh
                                </button>
                            </div>
                        </div>
                        <div class="ibox-content">
                            <table id="tblDumps"
                                   class="table table-striped table-bordered table-hover dataTables-example dataTable"
                                   style="width: 100%">
                                <thead>
                                <tr>
                                    <th>_id</th>
                                    <th>Connection Name</th>
                                    <th>Date</th>
                                    <th>File Path</th>
                                    <th>Size</th>
                                    <th>Import Status</th>
                                    <th>Import</th>
                                </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>

                        </div>
                        <div class="ibox-footer">
                            <!--<span class="pull-right">
                              The righ side of the footer
                        </span>-->
                            <div class="row">
                                <div class="col-lg-12">
                                    <button id="btnTakeDump"
                                            class="btn btn-block btn-outline btn-primary ladda-button"
                                            type="button"
                                            data-style="contract">
                                        <strong>Take Dump</strong></button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    {{/if}}
</template>